<template>
<h1>事件绑定指令</h1>
  <button @click="f1">按钮1</button>
  <button v-on:click="f2">按钮2</button>
  <h3>敲回车事件</h3>
  <input type="text" placeholder="请输入您要搜索的关键词" v-model="search" @keydown.enter="key_enter">
</template>
<script setup>
import {ref} from "vue";

const f1 = ()=>{
  alert('点击了按钮');
}
const f2 = ()=>{
  confirm('点击了按钮');
}
const search = ref('');
const key_enter = ()=>{
  alert(search.value);
}
</script>


<style scoped>

</style>